// Count the number of punctuation in a string.
// Date 09/10/2018
// By Ben

#include <iostream>

using namespace std;
using std::cout;
using std::endl;
using std::cin;

bool IsPunctuation(char c){
	bool mIsPunct = false;
	//Chars to check
	char *s0 = "!\"""#$%&'()*+,-./";

	//While we have a string loop
	while (*s0){
		//Check for punctuation
		if (*s0 == c){
			//Return true and exit loop
			mIsPunct = true;
			break;
		}
		//Move string along
		s0++;
	}
	//Return bool value
	return mIsPunct;
}

int main(int argc, char *argv[]){
	string s0 = "The quick brown fox, jumps over the, lazy dog.";
	int i = 0;
	int m_punct = 0;

	//Loop though the string
	while (i < s0.length()){
		//Check for Punctuation
		if (IsPunctuation(s0[i])){
			//INC punctuation counter
			m_punct++;
		}
		//INC counter
		i++;
	}

	//Show outputs
	std::cout << s0.c_str() << endl;
	std::cout << "Number of punctuation characters in the string is: " << m_punct << endl;

	system("pause");
	return 0;
}